<?php

namespace app\model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class WorldResource extends Model
{
    const TYPE_STONE = 1;
    const TYPE_WOOD = 2;
    const TYPE_GOLD = 3;

    public function __construct(array $attributes = [])
    {
        parent::__construct($attributes);
        $this->setTable('world_resource');
    }

    public function unit() : BelongsTo
    {
        return $this->belongsTo(WorldUnit::class, 'unit_id');
    }
}